﻿package mortal.game.scene3D.player.info
{
    import Message.BroadCast.*;
    import Message.DB.Tables.*;
    import Message.Game.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import com.gengine.core.frame.*;
    import com.gengine.debug.*;
    import com.gengine.utils.pools.*;
    import flash.events.*;
    import flash.utils.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.scene3D.player.type.*;
    import mortal.game.utils.*;
    import mortal.game.view.mainUI.avatar.view.*;
    import mortal.mvc.core.*;

    public class EntityInfo extends Object implements IDispose
    {
        private var _entityInfo:SEntityInfo;
        private var _bodySize:int;
        public var isUpdate:Boolean = false;
        public var isUpdateInfo:Boolean = false;
        public var isUpdateName:Boolean = false;
        public var isUpdateGuildName:Boolean = false;
        public var isUpdateTitle:Boolean = false;
        public var isUpdateLevel:Boolean = false;
        public var isUpdateLife:Boolean = false;
        public var isUpdateMana:Boolean = false;
        public var isUpdateSpeed:Boolean = false;
        public var isUpdateFighting:Boolean = false;
        public var isUpdateBuffer:Boolean = false;
        public var isUpdateMount:Boolean = false;
        public var isUpdateDirection:Boolean = false;
        public var isUpdateVIP:Boolean = false;
        public var isUpdateDisappear:Boolean = false;
        public var isUpdateModel:Boolean = false;
        public var isUpdateClothes:Boolean = false;
        public var isUpdateSpecialClothes:Boolean = false;
        public var isUpdateHair:Boolean = false;
        public var isUpdateWing:Boolean = false;
        public var isUpdateWeapon:Boolean = false;
        public var isUpdateWizard:Boolean = false;
        public var isUpdateCCS:Boolean = false;
        public var isUpdateFightMode:Boolean = false;
        public var isUpdateGrowthMax:Boolean = false;
        public var isUpdateStatus:Boolean = false;
        public var isUpdateZazen:Boolean = false;
        public var isUpdateFly:Boolean = false;
        public var isUpdateDoubleZazen:Boolean = false;
        public var isUpdateModelSize:Boolean = false;
        public var isUpdateBossBelong:Boolean = false;
        public var isUpdateSun:Boolean = false;
        public var isUpdatePlayMusical:Boolean = false;
        public var isUpdateDance:Boolean = false;
        public var isUpdateToast:Boolean = false;
        public var isUpdateDrunk:Boolean = false;
        public var isUpdateWineIndexs:Boolean = false;
        public var isUpdateBuffEndTime:Boolean = false;
        public var isUpdateWineLife:Boolean = false;
        public var isUpdateTreasureBox:Boolean = false;
        public var isUpdateMora:Boolean;
        public var isUpdateMoraReady:Boolean;
        public var isUpdateMoraBeauty:Boolean;
        public var isUpdateMoraThief:Boolean;
        public var isUpdateMoraPolice:Boolean;
        public var isUpdateTreasureHuntName:Boolean;
        public var isUpdateMainCityFlag:Boolean;
        public var isUpdateProxyLv:Boolean;
        public var isDead:Boolean = false;
        public var isTurned:Boolean = false;
        public var isHideWing:Boolean = false;
        public var turnModel:int = 0;
        public var fightingType:int = 0;
        public var isHasDisapperBuff:Boolean = false;
        public var isHasAmbushBuff:Boolean = false;
        public var isDisappear:Boolean = false;
        public var isInCollect:Boolean = false;
        public var isInSun:Boolean = false;
        public var isInPlayMusical:Boolean = false;
        public var isInDance:Boolean = false;
        public var isInToast:Boolean = false;
        public var isInDrunk:Boolean = false;
        public var isInMora:Boolean = false;
        public var isInMoraReady:Boolean = false;
        public var isInMoraBeauty:Boolean = false;
        public var isInMoraThief:Boolean = false;
        public var isInMoraPolice:Boolean = false;
        protected var _fashionClothes:int = 0;
        protected var _clothes:int = 0;
        protected var _hair:int = 0;
        protected var _wing:int = 0;
        protected var _fashionWeapon:int = 0;
        protected var _weapon:int = 0;
        protected var _petModelId:int = 0;
        public var isClothesItem:Boolean = false;
        public var isWingItem:Boolean = false;
        protected var _isWeaponItem:Boolean = false;
        public var isPetItem:Boolean = false;
        protected var _sunbathClothes:int = 0;
        protected var _sunbathWeapon:int = 0;
        protected var _winePartyClothes:int = 0;
        protected var _winePartyWeapon:int = 0;
        public var _buffEndTime:int = 0;
        public var reserveJs:ResjsInfo;
        public var addChainArray:Array;
        public var removeChainArray:Array;
        public var modelScale:Number = 0;
        public var wineIndexs:Array;
        public var treasureIndex:int = -1;
        public var treasureHuntRoleName:String;
        public var isSingleZazen:Boolean = false;
        public var isDoubleZazen:Boolean = false;
        public var zazenEntityId:SEntityId;
        public var isInBorn:Boolean = false;
        public var isInHidden:Boolean = false;
        public var isInFly:Boolean = false;
        public var isUpdateSpeicalStatus:Boolean = false;
        public var isUpdateCollect:Boolean = false;
        public var isHide:Boolean = false;
        public var isBossBelong:Boolean = false;
        public var isInRoleGroup:Boolean = false;
        public var isInRoleGuild:Boolean = false;
        public var isInFriend:Boolean = false;
        public var isAttackRole:Boolean = false;
        public var distance:Number = -1;
        public var isEnemy:Boolean = false;
        public var isInLayer:Boolean = false;
        private var dispatcher:IEventDispatcher;
        private var _shootT:int;

        public function EntityInfo()
        {
            this.reserveJs = new ResjsInfo();
            this.addChainArray = [];
            this.removeChainArray = [];
            this.wineIndexs = [];
            this.dispatcher = new EventDispatcher();
            this.reset();
            return;
        }// end function

        public function get bodySize() : int
        {
            var _loc_1:TBoss = null;
            var _loc_2:TPetConfig = null;
            if (this._bodySize <= 0)
            {
                switch(this._entityInfo.entityId.type)
                {
                    case EEntityType._EEntityTypePlayer:
                    {
                        this._bodySize = CareerConfig.instance.getBodySize(this._entityInfo.career, this._entityInfo.sex == ESex._ESexMan);
                        break;
                    }
                    case EEntityType._EEntityTypeBoss:
                    {
                        _loc_1 = BossConfig.instance.getInfoByCode(this._entityInfo.code);
                        if (_loc_1 != null)
                        {
                            this._bodySize = _loc_1.bodySize;
                        }
                        break;
                    }
                    case EEntityType._EEntityTypePet:
                    {
                        _loc_2 = PetConfig.instance.getInfoByCode(this._entityInfo.code);
                        if (_loc_2 != null)
                        {
                            this._bodySize = _loc_2.bodySize;
                        }
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            return this._bodySize;
        }// end function

        public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
        {
            this.dispatcher.addEventListener(param1, param2, param3, param4, param5);
            return;
        }// end function

        public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
        {
            this.dispatcher.removeEventListener(param1, param2, param3);
            return;
        }// end function

        public function dispatchEvent(event:Event) : Boolean
        {
            return this.dispatcher.dispatchEvent(event);
        }// end function

        public function hasEventListener(param1:String) : Boolean
        {
            return this.dispatcher.hasEventListener(param1);
        }// end function

        protected function reset() : void
        {
            this._entityInfo = new SEntityInfo();
            this._entityInfo.entityId = new SEntityId();
            this._entityInfo.camp = -1;
            this._entityInfo.career = -1;
            this._entityInfo.code = -1;
            this._entityInfo.level = -1;
            this._entityInfo.life = -1;
            this._entityInfo.mana = -1;
            this._entityInfo.maxLife = -1;
            this._entityInfo.maxMana = -1;
            this._entityInfo.name = "";
            this._entityInfo.speed = -1;
            this._entityInfo.status = -1;
            this._entityInfo.VIP = 0;
            this._entityInfo.fighting = false;
            this._entityInfo.fightMode = -1;
            this._entityInfo.speed = 0;
            this._entityInfo.direction = 0;
            this._entityInfo.reserveJs = "";
            this._entityInfo.points = [];
            this._entityInfo.buffInfos = [];
            this._entityInfo.entityShows = new Dictionary();
            this._entityInfo.guildId = new SEntityId();
            this._entityInfo.titleId = 0;
            if (this.isDead)
            {
                this.isDead = false;
                this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.Relive));
            }
            this.isTurned = false;
            this.isHideWing = false;
            this.turnModel = 0;
            this.isHasDisapperBuff = false;
            this.isHasAmbushBuff = false;
            this.isDisappear = false;
            this.isInCollect = false;
            this.isInSun = false;
            this.isInPlayMusical = false;
            this.isInDance = false;
            this.isInToast = false;
            this.isInDrunk = false;
            this.isInFly = false;
            this.isInMora = false;
            this.isInMoraReady = false;
            this.isInMoraBeauty = false;
            this.isInMoraPolice = false;
            this.isInMoraThief = false;
            this.fightingType = 0;
            this._fashionClothes = 0;
            this._sunbathClothes = 0;
            this._sunbathWeapon = 0;
            this._winePartyClothes = 0;
            this._winePartyWeapon = 0;
            this._clothes = 0;
            this._hair = 0;
            this._wing = 0;
            this._weapon = 0;
            this._petModelId = 0;
            this.isClothesItem = false;
            this.isWingItem = false;
            this._isWeaponItem = false;
            this.isPetItem = false;
            this._fashionWeapon = 0;
            this.reserveJs.clear();
            this.isSingleZazen = false;
            this.isDoubleZazen = false;
            this.zazenEntityId = null;
            this.isInBorn = false;
            this.isInHidden = false;
            this.isHide = false;
            this.isBossBelong = false;
            this.isInRoleGroup = false;
            this.isInRoleGuild = false;
            this.isInFriend = false;
            this.isAttackRole = false;
            this.distance = -1;
            this.isEnemy = false;
            this.isInLayer = false;
            this.modelScale = 0;
            this.wineIndexs.length = 0;
            this.treasureIndex = -1;
            this._buffEndTime = 0;
            this.treasureHuntRoleName = null;
            this.clearShootT();
            this.resetUpdateState();
            return;
        }// end function

        public function resetUpdateState() : void
        {
            this.isUpdate = false;
            this.isUpdateInfo = false;
            this.isUpdateLevel = false;
            this.isUpdateName = false;
            this.isUpdateGuildName = false;
            this.isUpdateTitle = false;
            this.isUpdateLife = false;
            this.isUpdateMana = false;
            this.isUpdateSpeed = false;
            this.isUpdateFighting = false;
            this.isUpdateBuffer = false;
            this.isUpdateMount = false;
            this.isUpdateDirection = false;
            this.isUpdateVIP = false;
            this.isUpdateDisappear = false;
            this.isUpdateModel = false;
            this.isUpdateClothes = false;
            this.isUpdateSpecialClothes = false;
            this.isUpdateHair = false;
            this.isUpdateWing = false;
            this.isUpdateWeapon = false;
            this.isUpdateWizard = false;
            this.isUpdateCCS = false;
            this.isUpdateFightMode = false;
            this.isUpdateGrowthMax = false;
            this.isUpdateStatus = false;
            this.isUpdateZazen = false;
            this.isUpdateFly = false;
            this.isUpdateDoubleZazen = false;
            this.isUpdateModelSize = false;
            this.isUpdateBossBelong = false;
            this.isUpdateSpeicalStatus = false;
            this.isUpdateCollect = false;
            this.isUpdateSun = false;
            this.isUpdatePlayMusical = false;
            this.isUpdateDance = false;
            this.isUpdateToast = false;
            this.isUpdateDrunk = false;
            this.isUpdateWineIndexs = false;
            this.isUpdateBuffEndTime = false;
            this.isUpdateWineLife = false;
            this.isUpdateTreasureBox = false;
            this.isUpdateMora = false;
            this.isUpdateMoraReady = false;
            this.isUpdateMoraBeauty = false;
            this.isUpdateMoraThief = false;
            this.isUpdateMoraPolice = false;
            this.isUpdateTreasureHuntName = false;
            this.isUpdateMainCityFlag = false;
            this.isUpdateProxyLv = false;
            this.addChainArray = [];
            this.removeChainArray = [];
            return;
        }// end function

        public function get entityInfo() : SEntityInfo
        {
            return this._entityInfo;
        }// end function

        public function set entityInfo(param1:SEntityInfo) : void
        {
            var _loc_2:int = 0;
            var _loc_3:SBuffInfo = null;
            var _loc_4:TBuff = null;
            this._entityInfo = param1;
            this.isUpdateInfo = true;
            for each (_loc_3 in param1.buffInfos)
            {
                
                _loc_4 = BuffConfig.instance.getInfoById(_loc_3.buffId);
                if (_loc_4.type == EBuffType._EBuffTypeDisappear || _loc_4.type == EBuffType._EBuffTypeTaskDisappear)
                {
                    this.isHasDisapperBuff = true;
                    this.isDisappear = true;
                    Log.system("初始化EntityInfo隐身", param1.name);
                    continue;
                }
                if (_loc_4.type == EBuffType._EBuffTypeAmbush)
                {
                    this.isHasAmbushBuff = true;
                    this.isDisappear = true;
                    continue;
                }
                if (_loc_4.type == EBuffType._EBuffTypeModelSize)
                {
                    this.modelScale = _loc_4.effect * 1 / 100;
                    continue;
                }
                if (_loc_4.type == EBuffType._EBuffTypeChain && _loc_3.fromEntityIds.length)
                {
                    this.addChainArray.push(_loc_3);
                    continue;
                }
                if (_loc_4.symbol == GameConst.TGuildWineDrunkBuffSymbol)
                {
                    this.updateStatus(EMoveStatus._EMoveStatusGuildDrunk);
                    continue;
                }
                if (_loc_4.buffId == GameConst.TGuildWineLanmuBuffId)
                {
                    this.wineIndexs.push(GameConst.TGuildWineLanmuBuffIndex);
                    this.isUpdateWineIndexs = true;
                    continue;
                }
                if (_loc_4.buffId == GameConst.TGuildWinePutaoBuffId)
                {
                    this.wineIndexs.splice(this.wineIndexs.indexOf(GameConst.TGuildWinePutaoBuffIndex), 1);
                    this.isUpdateWineIndexs = true;
                    continue;
                }
                if (_loc_4.buffId == GameConst.TGuildWineWhiskyBuffId)
                {
                    this.wineIndexs.splice(this.wineIndexs.indexOf(GameConst.TGuildWineWhiskyBuffIndex), 1);
                    this.isUpdateWineIndexs = true;
                    continue;
                }
                if (_loc_4.buffId == GameConst.TreasureBaiyinBoxBuffId)
                {
                    this.treasureIndex = 1;
                    this.isUpdateTreasureBox = true;
                    continue;
                }
                if (_loc_4.buffId == GameConst.TreasureHuangjinBoxBuffId)
                {
                    this.treasureIndex = 2;
                    this.isUpdateTreasureBox = true;
                    continue;
                }
                if (_loc_4.buffId == GameConst.TreasureZijinBoxBuffId)
                {
                    this.treasureIndex = 3;
                    this.isUpdateTreasureBox = true;
                }
            }
            if (this._entityInfo.entityShows)
            {
                this.updateModel(this._entityInfo.entityShows[EEntityAttribute._EAttributeModel]);
                this.updateFashionClothes(this._entityInfo.entityShows[EEntityAttribute._EAttributeFashion]);
                this.updateClothes(this._entityInfo.entityShows[EEntityAttribute._EAttributeClothes]);
                this.updateHair(this._entityInfo.entityShows[EEntityAttribute._EAttributeFashionHeadwear]);
                this.updateWing(this._entityInfo.entityShows[EEntityAttribute._EAttributeFashionWing]);
                this.updateFashionWeapon(this._entityInfo.entityShows[EEntityAttribute._EAttributeFashionWeapon]);
                this.updateWeapon(this._entityInfo.entityShows[EEntityAttribute._EAttributeWeapon]);
                this.updateSunbathClothes(this._entityInfo.entityShows[EEntityAttribute._EAttributeSwimSuit]);
                this.updateSunbathWeapon(this._entityInfo.entityShows[EEntityAttribute._EAttributeSwimTools]);
                this.updateHideWing(this._entityInfo.entityShows[EEntityAttribute._EAttributeHideWing]);
                this.updateWinePartyClothes(this._entityInfo.entityShows[EEntityAttribute._EAttributeGuildWineSuit]);
                this.updateWinePartyWeapon(this._entityInfo.entityShows[EEntityAttribute._EAttributeGuildWineCup]);
            }
            this.updateStatus(this._entityInfo.status);
            this.updateIsInRoleGroup();
            this.updateIsInRoleGuild();
            this.updateIsFriend();
            this.updateIsEnemy();
            this.updateIsDead();
            this.updateJs();
            this.updatePetCode(this._entityInfo.model);
            return;
        }// end function

        public function updateIsInRoleGroup() : void
        {
            this.isInRoleGroup = EntityUtil.equal(this._entityInfo.groupId, Cache.instance.group.groupId);
            return;
        }// end function

        public function updateIsInRoleGuild() : void
        {
            this.isInRoleGuild = this._entityInfo.guildId && this._entityInfo.guildId.id && EntityUtil.equal(this._entityInfo.guildId, Cache.instance.role.roleEntityInfo.entityInfo.guildId);
            return;
        }// end function

        public function updateIsFriend() : void
        {
            this.isInFriend = Cache.instance.friend.findRecordByRoleId(this._entityInfo.entityId.id) != null;
            return;
        }// end function

        public function updateIsAttackRole(param1:Boolean) : void
        {
            if (param1 != this.isAttackRole)
            {
                ThingUtil.isHeadContainerChange = true;
            }
            this.isAttackRole = param1;
            return;
        }// end function

        public function updateDistance(param1:Number) : void
        {
            this.distance = param1;
            return;
        }// end function

        public function updateIsEnemy() : void
        {
            this.isEnemy = !EntityRelationUtil.isFriend(this.entityInfo);
            return;
        }// end function

        protected function updateModel(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateModel = true;
            if (param1)
            {
                this.isTurned = true;
                this.turnModel = param1;
            }
            else
            {
                this.isTurned = false;
                this.turnModel = 0;
            }
            return;
        }// end function

        protected function updateFashionClothes(param1:int) : void
        {
            var _loc_4:TMountConfig = null;
            this.isUpdate = true;
            this.isUpdateClothes = true;
            var _loc_2:* = this.isSpecialClothes();
            var _loc_3:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_3)
            {
                this._fashionClothes = int(_loc_3.modelId);
                this.isClothesItem = true;
            }
            else
            {
                _loc_4 = MountConfig.instance.getMountInfoByCode(param1, EAdvanceComponentType._EAdvanceComponentTypeClothes) as TMountConfig;
                if (_loc_4)
                {
                    this._fashionClothes = int(_loc_4.modelId);
                }
                else
                {
                    this._fashionClothes = 0;
                }
                this.isClothesItem = false;
            }
            this.isUpdateSpecialClothes = this.isUpdateSpecialClothes || _loc_2 != this.isSpecialClothes();
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateClothes));
            return;
        }// end function

        protected function updateSunbathClothes(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateClothes = true;
            var _loc_2:* = this.isSpecialClothes();
            var _loc_3:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_3)
            {
                this._sunbathClothes = int(_loc_3.modelId);
            }
            else
            {
                this._sunbathClothes = 0;
            }
            this.isUpdateSpecialClothes = this.isUpdateSpecialClothes || _loc_2 != this.isSpecialClothes();
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateClothes));
            return;
        }// end function

        protected function updateWinePartyClothes(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateClothes = true;
            var _loc_2:* = this.isSpecialClothes();
            var _loc_3:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_3)
            {
                this._winePartyClothes = int(_loc_3.modelId);
            }
            else
            {
                this._winePartyClothes = 0;
            }
            this.isUpdateSpecialClothes = this.isUpdateSpecialClothes || _loc_2 != this.isSpecialClothes();
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateClothes));
            return;
        }// end function

        protected function updateClothes(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateClothes = true;
            var _loc_2:* = this.isSpecialClothes();
            var _loc_3:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_3)
            {
                this._clothes = int(_loc_3.modelId);
            }
            else
            {
                this._clothes = 0;
            }
            this.isUpdateSpecialClothes = this.isUpdateSpecialClothes || _loc_2 != this.isSpecialClothes();
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateClothes));
            return;
        }// end function

        protected function updateHair(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateHair = true;
            var _loc_2:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_2)
            {
                this._hair = int(_loc_2.modelId);
            }
            else
            {
                this._hair = param1 == -1 ? (param1) : (0);
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.updateHair));
            return;
        }// end function

        protected function updateWing(param1:int) : void
        {
            var _loc_3:TMountConfig = null;
            this.isUpdate = true;
            this.isUpdateWing = true;
            var _loc_2:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_2)
            {
                this._wing = int(_loc_2.modelId);
                this.isWingItem = true;
            }
            else
            {
                _loc_3 = MountConfig.instance.getMountInfoByCode(param1, EFashionType._EFashionWing) as TMountConfig;
                if (_loc_3)
                {
                    this._wing = int(_loc_3.modelId);
                }
                else
                {
                    this._wing = 0;
                }
                this.isWingItem = false;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.updateWing));
            return;
        }// end function

        protected function updatePetCode(param1:int) : void
        {
            var _loc_2:TMountConfig = null;
            var _loc_3:ItemEquipInfo = null;
            this.isUpdate = true;
            this.isUpdateModel = true;
            this._entityInfo.model = param1;
            if (param1 < 100)
            {
                _loc_2 = MountConfig.instance.getFashionInfoByCode(EAdvanceComponentType._EAdvanceComponentTypePet, param1);
                if (_loc_2)
                {
                    this._petModelId = _loc_2.modelId;
                }
            }
            else
            {
                _loc_3 = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
                if (_loc_3)
                {
                    this._petModelId = int(_loc_3.modelId);
                    this.isPetItem = true;
                }
            }
            return;
        }// end function

        protected function updateCamp(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateCCS = true;
            this.isUpdateName = true;
            this._entityInfo.camp = param1;
            return;
        }// end function

        protected function updateForce(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateName = true;
            this.isUpdateLife = true;
            this._entityInfo.force = param1;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateForce));
            return;
        }// end function

        protected function updateTitle(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateTitle = true;
            this._entityInfo.titleId = param1;
            return;
        }// end function

        protected function updateWeapon(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateWeapon = true;
            var _loc_2:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_2)
            {
                this._weapon = int(_loc_2.modelId);
            }
            else
            {
                this._weapon = 0;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateWeapon));
            return;
        }// end function

        public function updateSunbathWeapon(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateWeapon = true;
            var _loc_2:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_2)
            {
                this._sunbathWeapon = int(_loc_2.modelId);
            }
            else
            {
                this._sunbathWeapon = param1;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateWeapon));
            return;
        }// end function

        public function updateShootWeapon() : void
        {
            this.clearShootT();
            this.updateSunbathWeapon(100151111);
            this._shootT = setTimeout(this.updateSunbathWeapon, 1400, 1);
            return;
        }// end function

        private function clearShootT() : void
        {
            if (this._shootT)
            {
                clearTimeout(this._shootT);
                this._shootT = 0;
            }
            return;
        }// end function

        protected function updateWinePartyWeapon(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateWeapon = true;
            var _loc_2:* = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
            if (_loc_2)
            {
                this._winePartyWeapon = int(_loc_2.modelId);
            }
            else
            {
                this._winePartyWeapon = param1;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateWeapon));
            return;
        }// end function

        protected function updateHideWing(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateWing = true;
            this.isHideWing = param1 != 0;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.updateWing));
            return;
        }// end function

        public function updatebuffEndTime(param1:int) : void
        {
            if (param1 > 0)
            {
                this._buffEndTime = param1 + FrameManager.flashFrame.getTime();
            }
            else
            {
                this._buffEndTime = 0;
            }
            this.isUpdate = true;
            this.isUpdateBuffEndTime = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateBuffEndTime));
            return;
        }// end function

        public function updateWizard(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateWizard = true;
            this._entityInfo.spriteCode = param1;
            return;
        }// end function

        protected function updateFashionWeapon(param1:int) : void
        {
            var _loc_2:int = 0;
            var _loc_3:ItemInfo = null;
            var _loc_4:TMountConfig = null;
            this.isUpdate = true;
            this.isUpdateWeapon = true;
            if (param1 > 100)
            {
                _loc_3 = ItemConfig.instance.getConfig(param1);
                if (_loc_3 && _loc_3 is ItemEquipInfo)
                {
                    _loc_2 = (_loc_3 as ItemEquipInfo).modelId;
                    this._isWeaponItem = true;
                }
            }
            else
            {
                _loc_4 = MountConfig.instance.getMountInfoByCode(param1, EFashionType._EFashionWeapon) as TMountConfig;
                _loc_2 = _loc_4 == null ? (0) : (_loc_4.modelId);
                this._isWeaponItem = false;
            }
            this._fashionWeapon = _loc_2;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateWeapon));
            return;
        }// end function

        public function get clothes() : int
        {
            if (this._winePartyClothes)
            {
                return this._winePartyClothes;
            }
            if (this._sunbathClothes)
            {
                return this._sunbathClothes;
            }
            if (this._fashionClothes)
            {
                return this._fashionClothes;
            }
            return this._clothes;
        }// end function

        public function isSpecialClothes() : Boolean
        {
            return Boolean(this._winePartyClothes) || Boolean(this._sunbathClothes) || Boolean(this.isTurned);
        }// end function

        public function get sunbathClothes() : int
        {
            return this._sunbathClothes;
        }// end function

        public function get sunbathWeapon() : int
        {
            return this._sunbathWeapon;
        }// end function

        public function get winePartyClothes() : int
        {
            return this._winePartyClothes;
        }// end function

        public function get winePartyWeapon() : int
        {
            return this._winePartyWeapon;
        }// end function

        public function get hair() : int
        {
            return this._hair;
        }// end function

        public function get wing() : int
        {
            return this._wing;
        }// end function

        public function get weapon() : int
        {
            if (this._winePartyWeapon)
            {
                return this._winePartyWeapon;
            }
            if (this._sunbathWeapon)
            {
                return this._sunbathWeapon;
            }
            if (this._fashionWeapon && !GameMapUtil.curMapState.isSunbathMap && !GameMapUtil.curMapState.isWineMap)
            {
                return this._fashionWeapon;
            }
            return this._weapon;
        }// end function

        public function get isWeaponItem() : Boolean
        {
            if (this._winePartyWeapon)
            {
                return false;
            }
            if (this._sunbathWeapon)
            {
                return false;
            }
            if (this._fashionWeapon && !GameMapUtil.curMapState.isSunbathMap && !GameMapUtil.curMapState.isWineMap)
            {
                return this._isWeaponItem;
            }
            return false;
        }// end function

        public function get buffEndTime() : int
        {
            return this._buffEndTime;
        }// end function

        public function updateAttribute(param1:Array, param2:Boolean = true) : void
        {
            var _loc_5:SAttributeUpdate = null;
            var _loc_3:* = param1.length;
            var _loc_4:uint = 0;
            while (_loc_4 < _loc_3)
            {
                
                _loc_5 = param1[_loc_4] as SAttributeUpdate;
                if (_loc_5.attribute)
                {
                    switch(_loc_5.attribute.__value)
                    {
                        case EEntityAttribute._EAttributeUsername:
                        {
                            this.updateName(_loc_5.valueStr);
                            break;
                        }
                        case EEntityAttribute._EAttributeName:
                        {
                            this.updateName(_loc_5.valueStr);
                            break;
                        }
                        case EEntityAttribute._EAttributeLevel:
                        {
                            this.updateLevel(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeLife:
                        {
                            this.updateLife(_loc_5.value, param2);
                            break;
                        }
                        case EEntityAttribute._EAttributeMaxLife:
                        {
                            this.updateMaxLife(_loc_5.value, param2);
                            break;
                        }
                        case EEntityAttribute._EAttributeMana:
                        {
                            this._entityInfo.mana = _loc_5.value;
                            this.isUpdateMana = true;
                            this.isUpdate = true;
                            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateMana));
                            break;
                        }
                        case EEntityAttribute._EAttributeMaxMana:
                        {
                            this.updateMaxMana(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeSpeed:
                        {
                            this.updateSpeed(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeCombat:
                        {
                            if (this._entityInfo.combat && this._entityInfo.combat < _loc_5.value)
                            {
                                CombatEffect.instance.showEffect(this._entityInfo.combat.toString(), _loc_5.value.toString());
                            }
                            this._entityInfo.combat = _loc_5.value;
                            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateComBat));
                            break;
                        }
                        case EEntityAttribute._EAttributeFighting:
                        {
                            this.updateFighting(Boolean(_loc_5.value), int(_loc_5.valueStr));
                            break;
                        }
                        case EEntityAttribute._EAttributeBuff:
                        {
                            break;
                        }
                        case EEntityAttribute._EAttributeMount:
                        {
                            this.isUpdate = true;
                            this.isUpdateMount = true;
                            this._entityInfo.mountCode = _loc_5.value;
                            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateMount));
                            break;
                        }
                        case EEntityAttribute._EAttributeDirection:
                        {
                            this.isUpdate = true;
                            this.isUpdateDirection = true;
                            this._entityInfo.direction = _loc_5.value;
                            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateDirection));
                            break;
                        }
                        case EEntityAttribute._EAttributeVipLevel:
                        {
                            this.isUpdate = true;
                            this.isUpdateVIP = true;
                            this._entityInfo.VIP = _loc_5.value;
                            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateDirection));
                            break;
                        }
                        case EEntityAttribute._EAttributeModel:
                        {
                            this.updateModel(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeFashion:
                        {
                            this.updateFashionClothes(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeClothes:
                        {
                            this.updateClothes(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeFashionHeadwear:
                        {
                            this.updateHair(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeFashionWing:
                        {
                            this.updateWing(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeFashionWeapon:
                        {
                            this.updateFashionWeapon(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeWeapon:
                        {
                            this.updateWeapon(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeSprite:
                        {
                            this.updateWizard(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeCamp:
                        {
                            this.updateCamp(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeCareer:
                        {
                            this.updateCareer(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeFightMode:
                        {
                            this.updateFightMode(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeForce:
                        {
                            this.updateForce(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeTitle:
                        {
                            this.updateTitle(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeGuildName:
                        {
                            this.updateGuildName(_loc_5.valueStr);
                            break;
                        }
                        case EEntityAttribute._EAttributeGuildPosition:
                        {
                            this.updateGuildPosition(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeStatus:
                        {
                            this.updateStatus(_loc_5.value, _loc_5.valueStr);
                            break;
                        }
                        case EEntityAttribute._EAttributePet2Code:
                        {
                            this.updatePetCode(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributePet2SharpCode:
                        {
                            this.updatePetCode(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeReverseJs:
                        {
                            this._entityInfo.reserveJs = _loc_5.valueStr;
                            this.updateJs();
                            break;
                        }
                        case EEntityAttribute._EAttributeSwimSuit:
                        {
                            this.updateSunbathClothes(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeSwimTools:
                        {
                            this.updateSunbathWeapon(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeGuildWineSuit:
                        {
                            this.updateWinePartyClothes(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeGuildWineCup:
                        {
                            this.updateWinePartyWeapon(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeHideWing:
                        {
                            this.updateHideWing(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeRaidersBufferTime:
                        {
                            this.updatebuffEndTime(_loc_5.value);
                            break;
                        }
                        case EEntityAttribute._EAttributeMaskName:
                        {
                            this.isUpdate = true;
                            this.isUpdateTreasureHuntName = true;
                            this.isUpdateName = true;
                            this.treasureHuntRoleName = _loc_5.valueStr;
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                }
                _loc_4 = _loc_4 + 1;
            }
            return;
        }// end function

        public function updateLifeShow() : void
        {
            this.isUpdateLife = true;
            this.isUpdate = true;
            return;
        }// end function

        public function updateLife(param1:int, param2:Boolean = true) : void
        {
            this._entityInfo.life = param1;
            if (param2)
            {
                this.isUpdateLife = true;
                this.isUpdate = true;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateLife));
            this.updateIsDead();
            return;
        }// end function

        public function updateIsDead() : void
        {
            if (this.isDead && this._entityInfo.life > 0)
            {
                this.isDead = false;
                this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.Relive));
            }
            else if (!this.isDead && this._entityInfo.life <= 0)
            {
                this.isDead = true;
                this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.Dead));
            }
            return;
        }// end function

        private function checkJsUpdate(param1:ResjsInfo, param2, param3:String) : Boolean
        {
            if (!param1[param3] && !param2[param3])
            {
                return false;
            }
            if (param1[param3] && param2[param3])
            {
                if (param1[param3] == param2[param3])
                {
                    return false;
                }
            }
            return true;
        }// end function

        public function updateJs() : void
        {
            this.isUpdate = true;
            var _loc_1:* = new Object();
            if (this._entityInfo.reserveJs)
            {
                _loc_1 = JSON.parse(this._entityInfo.reserveJs);
            }
            if (this.checkJsUpdate(this.reserveJs, _loc_1, "guild_war_guild_name"))
            {
                this.isUpdateGuildName = true;
                this.isUpdateName = true;
            }
            this.isUpdateBuffEndTime = this.checkJsUpdate(this.reserveJs, _loc_1, "ra_sec");
            this.isUpdateWineLife = this.checkJsUpdate(this.reserveJs, _loc_1, "pal");
            this.isUpdateMainCityFlag = this.checkJsUpdate(this.reserveJs, _loc_1, "maincity_flag");
            this.isUpdateProxyLv = this.checkJsUpdate(this.reserveJs, _loc_1, "proxy_lv") || this.checkJsUpdate(this.reserveJs, _loc_1, "proxy_ex") || this.checkJsUpdate(this.reserveJs, _loc_1, "proxy_ex2");
            this.isUpdateProxyLv = this.isUpdateProxyLv || this.checkJsUpdate(this.reserveJs, _loc_1, "tx_1") || this.checkJsUpdate(this.reserveJs, _loc_1, "tx_2");
            this.reserveJs.clear();
            if (this._entityInfo.reserveJs)
            {
                this.reserveJs.putObject(_loc_1);
            }
            if (this.reserveJs.ra_sec)
            {
                this._buffEndTime = this.reserveJs.ra_sec + FrameManager.flashFrame.getTime();
            }
            else
            {
                this._buffEndTime = 0;
            }
            return;
        }// end function

        public function clearGuildWarGuildNameJs() : void
        {
            this.reserveJs.clearGuildWarGuildName();
            this.isUpdate = true;
            this.isUpdateGuildName = true;
            this.isUpdateName = true;
            return;
        }// end function

        public function clearMainCityFlag() : void
        {
            this.reserveJs.clearMainCityFlag();
            this.isUpdate = true;
            this.isUpdateMainCityFlag = true;
            return;
        }// end function

        public function updateMaxLife(param1:int, param2:Boolean = true) : void
        {
            this._entityInfo.maxLife = param1;
            if (param2)
            {
                this.isUpdateLife = true;
                this.isUpdate = true;
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateLife));
            return;
        }// end function

        public function updateMaxMana(param1:int) : void
        {
            this._entityInfo.maxMana = param1;
            this.isUpdateMana = true;
            this.isUpdate = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateMana));
            return;
        }// end function

        public function updateSpeed(param1:int) : void
        {
            this._entityInfo.speed = param1;
            this.isUpdate = true;
            this.isUpdateSpeed = true;
            return;
        }// end function

        public function updateFighting(param1:Boolean, param2:int) : void
        {
            this._entityInfo.fighting = param1;
            this.fightingType = param2;
            this.isUpdateFighting = true;
            this.isUpdate = true;
            return;
        }// end function

        public function updateName(param1:String) : void
        {
            this._entityInfo.name = param1;
            this.isUpdate = true;
            this.isUpdateName = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateName));
            return;
        }// end function

        public function updateLevel(param1:int) : void
        {
            this._entityInfo.level = param1;
            this.isUpdate = true;
            this.isUpdateLevel = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateLevel));
            return;
        }// end function

        public function updateCareer(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateCCS = true;
            this._entityInfo.career = param1;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateCareer));
            return;
        }// end function

        public function updateSex(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateCCS = true;
            this._entityInfo.sex = param1;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateSex));
            return;
        }// end function

        public function updateStatus(param1:int, param2:String = null, param3:Boolean = false) : void
        {
            var _loc_4:Boolean = false;
            var _loc_5:Array = null;
            if (param2)
            {
                if (!this._entityInfo.toEntityId)
                {
                    this._entityInfo.toEntityId = new SEntityId();
                }
                _loc_5 = param2.split("#");
                this._entityInfo.toEntityId.id = _loc_5[0];
                this._entityInfo.toEntityId.type = _loc_5[1];
                this._entityInfo.toEntityId.typeEx = _loc_5[2];
                this._entityInfo.toEntityId.typeEx2 = _loc_5[3];
            }
            this.isUpdate = true;
            this.isUpdateStatus = true;
            _loc_4 = param1 == EMoveStatus._EMoveStatusZazen;
            this.isUpdateZazen = this.isUpdateZazen || _loc_4 != this.isSingleZazen;
            this.isSingleZazen = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusBorn;
            this.isUpdateSpeicalStatus = this.isUpdateSpeicalStatus || _loc_4 != this.isInBorn;
            this.isInBorn = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusDisappear;
            this.isUpdateSpeicalStatus = this.isUpdateSpeicalStatus || _loc_4 != this.isInHidden;
            this.isInHidden = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusCollect;
            this.isUpdateCollect = this.isUpdateCollect || this.isInCollect != _loc_4;
            this.isInCollect = _loc_4;
            if (!this.isInCollect && this.isUpdateCollect)
            {
                this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.LeaveCollect));
            }
            _loc_4 = param1 == EMoveStatus._EMoveStatusFly;
            this.isUpdateFly = this.isUpdateFly || this.isInFly != _loc_4;
            this.isInFly = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusSunbath;
            this.isUpdateSun = this.isUpdateSun || this.isInSun != _loc_4;
            this.isInSun = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusPerform;
            this.isUpdatePlayMusical = this.isUpdatePlayMusical || this.isInPlayMusical != _loc_4;
            this.isInPlayMusical = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusDance;
            this.isUpdateDance = this.isUpdateDance || this.isInDance != _loc_4;
            this.isInDance = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusGuildToast;
            this.isUpdateToast = this.isUpdateToast || this.isInToast != _loc_4;
            this.isInToast = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusMoraReady;
            this.isUpdateMoraReady = this.isUpdateMoraReady || this.isInMoraReady != _loc_4;
            this.isInMoraReady = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusMoraBeauty;
            this.isUpdateMoraBeauty = this.isUpdateMoraBeauty || this.isInMoraBeauty != _loc_4;
            this.isInMoraBeauty = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusMoraThief;
            this.isUpdateMoraThief = this.isUpdateMoraThief || this.isInMoraThief != _loc_4;
            this.isInMoraThief = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusMoraPolice;
            this.isUpdateMoraPolice = this.isUpdateMoraPolice || this.isInMoraPolice != _loc_4;
            this.isInMoraPolice = _loc_4;
            _loc_4 = param1 == EMoveStatus._EMoveStatusMoraReady || param1 == EMoveStatus._EMoveStatusMoraBeauty || param1 == EMoveStatus._EMoveStatusMoraThief || param1 == EMoveStatus._EMoveStatusMoraPolice;
            this.isUpdateMora = this.isUpdateMora || this.isInMora != _loc_4;
            this.isInMora = _loc_4;
            if (this.isInDrunk && param1 == EMoveStatus._EMoveStatusNormal && !param3)
            {
            }
            else
            {
                _loc_4 = param1 == EMoveStatus._EMoveStatusGuildDrunk;
                this.isUpdateDrunk = this.isUpdateDrunk || this.isInDrunk != _loc_4;
                this.isInDrunk = _loc_4;
                if (this.isUpdateDrunk && this.entityInfo.sex == ESex._ESexWoman)
                {
                    if (this.isInDrunk)
                    {
                        this.updateWinePartyWeapon(100151112);
                    }
                    else
                    {
                        this.updateWinePartyWeapon(1);
                    }
                }
            }
            this._entityInfo.status = param1;
            if (param1 != EMoveStatus._EMoveStatusDoubleZazen)
            {
                this.updateZazenEntityId(null);
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateStatus));
            return;
        }// end function

        public function updateZazenEntityId(param1:SEntityId) : void
        {
            this.zazenEntityId = param1;
            var _loc_2:* = param1 != null;
            this.isUpdateDoubleZazen = this.isUpdateDoubleZazen || _loc_2 != this.isDoubleZazen;
            this.isDoubleZazen = _loc_2;
            return;
        }// end function

        public function updateFightMode(param1:int) : void
        {
            this._entityInfo.fightMode = param1;
            this.isUpdate = true;
            this.isUpdateFightMode = true;
            this.isUpdateName = true;
            this.isUpdateLife = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateFightMode));
            var _loc_2:* = Cache.instance.entity.getOwnerEntityList(this.entityInfo.entityId);
            var _loc_3:* = _loc_2.length;
            var _loc_4:int = 0;
            while (_loc_4 < _loc_3)
            {
                
                _loc_2[_loc_4].isUpdate = true;
                _loc_2[_loc_4].isUpdateName = true;
                _loc_2[_loc_4].isUpdateLife = true;
                _loc_4++;
            }
            return;
        }// end function

        public function updateBufferInfo(param1:SBuffInfo, param2:int) : void
        {
            var _loc_3:int = 0;
            var _loc_6:int = 0;
            var _loc_4:* = param1.buffId;
            var _loc_5:* = BuffConfig.instance.getInfoById(_loc_4);
            if (_loc_5.type == EBuffType._EBuffTypeDisappear || _loc_5.type == EBuffType._EBuffTypeTaskDisappear)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.isHasDisapperBuff = true;
                    Log.system("updateBuffer隐身", _loc_4, param2);
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.isHasDisapperBuff = false;
                    Log.system("updateBuffer取消隐身", _loc_4, param2);
                }
                this.isUpdateDisappear = true;
                ThingUtil.isEntitySort = true;
            }
            if (_loc_5.type == EBuffType._EBuffTypeAmbush)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.isHasAmbushBuff = true;
                    Log.system("updateBuffer潜伏", _loc_4, param2);
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.isHasAmbushBuff = false;
                    Log.system("updateBuffer取消潜伏", _loc_4, param2);
                }
                this.isUpdateDisappear = true;
                ThingUtil.isEntitySort = true;
            }
            this.isDisappear = this.isHasAmbushBuff || this.isHasDisapperBuff;
            if (_loc_5.type == EBuffType._EBuffTypeModelSize)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.modelScale = _loc_5.effect * 1 / 100;
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.modelScale = 0;
                }
                this.isUpdateModelSize = true;
            }
            if (_loc_5.symbol == GameConst.TGuildWineDrunkBuffSymbol)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.updateStatus(EMoveStatus._EMoveStatusGuildDrunk);
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.updateStatus(EMoveStatus._EMoveStatusNormal, null, true);
                }
            }
            if (_loc_5.buffId == GameConst.TGuildWineLanmuBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    if (this.wineIndexs.indexOf(GameConst.TGuildWineLanmuBuffIndex) == -1)
                    {
                        this.wineIndexs.push(GameConst.TGuildWineLanmuBuffIndex);
                    }
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.wineIndexs.splice(this.wineIndexs.indexOf(GameConst.TGuildWineLanmuBuffIndex), 1);
                }
                this.isUpdateWineIndexs = true;
            }
            if (_loc_5.buffId == GameConst.TGuildWinePutaoBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    if (this.wineIndexs.indexOf(GameConst.TGuildWinePutaoBuffIndex) == -1)
                    {
                        this.wineIndexs.push(GameConst.TGuildWinePutaoBuffIndex);
                    }
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.wineIndexs.splice(this.wineIndexs.indexOf(GameConst.TGuildWinePutaoBuffIndex), 1);
                }
                this.isUpdateWineIndexs = true;
            }
            if (_loc_5.buffId == GameConst.TGuildWineWhiskyBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    if (this.wineIndexs.indexOf(GameConst.TGuildWineWhiskyBuffIndex) == -1)
                    {
                        this.wineIndexs.push(GameConst.TGuildWineWhiskyBuffIndex);
                    }
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.wineIndexs.splice(this.wineIndexs.indexOf(GameConst.TGuildWineWhiskyBuffIndex), 1);
                }
                this.isUpdateWineIndexs = true;
            }
            if (_loc_5.buffId == GameConst.TreasureBaiyinBoxBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.treasureIndex = 1;
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.treasureIndex = -1;
                }
                this.isUpdateTreasureBox = true;
            }
            if (_loc_5.buffId == GameConst.TreasureHuangjinBoxBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.treasureIndex = 2;
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.treasureIndex = -1;
                }
                this.isUpdateTreasureBox = true;
            }
            if (_loc_5.buffId == GameConst.TreasureZijinBoxBuffId)
            {
                if (param2 == EBuffUpdateType._EBuffUpdateTypeAdd)
                {
                    this.treasureIndex = 3;
                }
                else if (param2 == EBuffUpdateType._EBuffUpdateTypeRemove)
                {
                    this.treasureIndex = -1;
                }
                this.isUpdateTreasureBox = true;
            }
            switch(param2)
            {
                case EBuffUpdateType._EBuffUpdateTypeAdd:
                {
                    this._entityInfo.buffInfos.push(param1);
                    if (_loc_5.type == EBuffType._EBuffTypeChain && param1.fromEntityIds.length)
                    {
                        this.addChainArray.push(param1);
                    }
                    break;
                }
                case EBuffUpdateType._EBuffUpdateTypeRemove:
                {
                    _loc_6 = this._entityInfo.buffInfos.length;
                    _loc_3 = _loc_6 - 1;
                    while (_loc_3 >= 0)
                    {
                        
                        if ((this._entityInfo.buffInfos[_loc_3] as SBuffInfo).buffId == _loc_4)
                        {
                            if (_loc_5.type == EBuffType._EBuffTypeChain && (this._entityInfo.buffInfos[_loc_3] as SBuffInfo).fromEntityIds.length)
                            {
                                this.removeChainArray.push(param1);
                            }
                            this._entityInfo.buffInfos.splice(_loc_3, 1);
                        }
                        _loc_3 = _loc_3 - 1;
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            this.isUpdate = true;
            this.isUpdateBuffer = true;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateBuffs));
            return;
        }// end function

        public function updateGuildId(param1:int) : void
        {
            var _loc_2:* = new SEntityId();
            _loc_2.id = param1;
            _loc_2.type = EEntityType._EEntityTypeGuild;
            _loc_2.typeEx = this.entityInfo.entityId.typeEx;
            _loc_2.typeEx2 = this.entityInfo.entityId.typeEx2;
            this._entityInfo.guildId = _loc_2;
            this.updateIsInRoleGuild();
            this.updateBossBelogByGuildId(_loc_2);
            this.isUpdateName = true;
            this.isUpdateLife = true;
            this.isUpdate = true;
            return;
        }// end function

        public function updateGuildIdByEntityId(param1:SEntityId) : void
        {
            this._entityInfo.guildId = param1;
            this.updateIsInRoleGuild();
            this.updateBossBelogByGuildId(param1);
            this.isUpdate = true;
            this.isUpdateName = true;
            this.isUpdateLife = true;
            return;
        }// end function

        private function updateBossBelogByGuildId(param1:SEntityId) : void
        {
            var _loc_2:* = Cache.instance.copy.worldBoss.belongGuildId;
            this.updateBossBelong(_loc_2 && _loc_2.id && EntityUtil.equal(_loc_2, param1));
            return;
        }// end function

        public function updateGuildName(param1:String) : void
        {
            this.isUpdate = true;
            this.isUpdateGuildName = true;
            this._entityInfo.guildName = param1;
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateGuild));
            return;
        }// end function

        public function updateGuildPosition(param1:int) : void
        {
            this.isUpdate = true;
            this.isUpdateGuildName = true;
            this._entityInfo.guildPosition = param1;
            return;
        }// end function

        public function updateGroupId(param1:SEntityId) : void
        {
            this.isUpdate = true;
            this.isUpdateName = true;
            this.isUpdateLife = true;
            this._entityInfo.groupId = param1;
            var _loc_2:* = BossConfig.instance.getInfoByCode(this._entityInfo.code);
            if (EntityUtil.equal(param1, Cache.instance.group.groupId) && (this.entityInfo.entityId.type == EEntityType._EEntityTypePlayer || _loc_2 && _loc_2.category == EBossCategory._EBossCategoryRobot))
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.SceneAddGroupmate, this));
            }
            this.updateIsInRoleGroup();
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.UpdateGroupId));
            return;
        }// end function

        public function updateBossBelong(param1:Boolean) : void
        {
            if (this.isBossBelong != param1)
            {
                this.isUpdate = true;
                this.isUpdateBossBelong = true;
                this.isBossBelong = param1;
            }
            return;
        }// end function

        public function get isSelf() : Boolean
        {
            if (this._entityInfo.ownerEntityId)
            {
                if (EntityUtil.equal(this._entityInfo.ownerEntityId, RolePlayer.instance.entityInfo.entityInfo.entityId))
                {
                    return true;
                }
            }
            return false;
        }// end function

        public function get hostEntity() : SEntityId
        {
            return null;
        }// end function

        public function get attachType() : int
        {
            return AttachType.NoAttach;
        }// end function

        public function isAttachSelf(param1:SEntityId) : Boolean
        {
            return false;
        }// end function

        public function isAttachTeam(param1:SEntityId) : Boolean
        {
            return false;
        }// end function

        public function isCanAttack() : Boolean
        {
            return false;
        }// end function

        public function get fighting() : Boolean
        {
            return this._entityInfo.fighting;
        }// end function

        public function isInPVPFighting() : Boolean
        {
            return this._entityInfo.fighting && this.fightingType == EFightingType._EFightingTypePVP;
        }// end function

        public function setNotFighting() : void
        {
            this._entityInfo.fighting = false;
            this.isUpdateFighting = true;
            return;
        }// end function

        public function get isInZazen() : Boolean
        {
            return this.isSingleZazen || this.isDoubleZazen;
        }// end function

        public function dispose(param1:Boolean = true) : void
        {
            this.reset();
            this._bodySize = -1;
            if (param1)
            {
                ObjectPool.disposeObject(this, EntityInfo);
            }
            this.dispatchEvent(new EntityInfoEvent(EntityInfoEventName.DisposeEntity));
            return;
        }// end function

        public function get petModelId() : int
        {
            return this._petModelId;
        }// end function

    }
}
